//
//  ViewControllerA.m
//  Navi
//
//  Created by Justsoso on 16/2/25.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "ViewControllerA.h"

#import "ViewControllerB.h"
#import "ViewControllerC.h"
#import "ViewControllerD.h"

@interface ViewControllerA ()

@end

@implementation ViewControllerA

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}
- (IBAction)pushA:(id)sender
{
    ViewControllerA *vcA = [[ViewControllerA alloc] init];
    [self.navigationController pushViewController:vcA animated:YES];
}
- (IBAction)pushB:(id)sender
{
    ViewControllerB *vcB = [[ViewControllerB alloc] init];
    [self.navigationController pushViewController:vcB animated:YES];
}
- (IBAction)pushC:(id)sender
{
    ViewControllerC *vcC = [[ViewControllerC alloc] init];
    [self.navigationController pushViewController:vcC animated:YES];
}
- (IBAction)pushD:(id)sender
{
    ViewControllerD *vcD = [[ViewControllerD alloc] init];
    [self.navigationController pushViewController:vcD animated:YES];
    
}
- (IBAction)pop:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}
- (IBAction)popTo2:(id)sender
{
    if (self.navigationController.viewControllers.count > 2)
    {
        [self.navigationController popToViewController:self.navigationController.viewControllers[1] animated:YES];
    }
    
}
- (IBAction)popToRoot:(id)sender
{
    [self.navigationController popToRootViewControllerAnimated:YES];
}


@end
